package com.rsk.dao.curriculum;


import java.io.Serializable;
import java.util.List;
import java.util.Map;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import com.rsk.entity.curriculum.RskCourseExamine;



@Repository
public interface RskCourseExamineRepository extends JpaRepository<RskCourseExamine, Long>,JpaSpecificationExecutor<RskCourseExamine>,Serializable {
	
	@Modifying
	@Query(value = "update rsk_course_examine set is_del = 1, operator_user =?2, operator_time = NOW() where id =?1", nativeQuery = true)
	public int delRskCourseExamine(Long id, Long operatorUser);
	

	
	@SuppressWarnings("rawtypes")
	@Query(value = "select rce.id,rc.course_name,rce.examine_status,rce.examine_remarks"
			+ ",su.user_name,rce.operator_time from rsk_course_examine rce"
			+ " left join sys_users su on rce.operator_user = su.id"
			+ " left join rsk_course rc on rce.course_id = rc.id"
			+ " where rce.is_del = 0 and rce.course_id=?1 order by rce.operator_time desc", nativeQuery = true)
	public List<Map> selectRskCourseExamine(Long courseId);
	
	
}
 